Skip to main content

Classes

As C# is a object oriented programming language, is uses objects and classes.

Mean that we can use repeatable things.

So if you where createng a book store online and wanted to store book info you could make a class which has all the information store in object.

Create a class:

class Book
{
public string title;
public string author;
public int pages;
}

Create a object of class

{
Book book1 = new Book();
book1.title = "HP title";
book1.author = "HP Author";
book1.page = 400;
}